home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_bab_archivebridge.cog < prev    next >
Text File  |  1999-11-15  |  13KB  |  426 lines

  1. # Jones 3D Cog Script
  2. #
  3. # BAB_ArchiveBridge.cog
  4. #
  5. # Controls the behaviour of the uppermost bridge in the Babylon Archives
  6. #
  7. # [SXC & revised by HB]
  8. #
  9. # (C) 1998 LucasArts Entertainment Co. All Rights Reserved
  10. # ========================================================================================
  11.  
  12. symbols
  13.  
  14. # MESSAGES ########################################################
  15.  
  16. message     startup
  17. message     entered
  18. message        user6
  19. message     pulse
  20.  
  21. # THINGS ##########################################################
  22.  
  23. thing       player          local          
  24. thing       frag0           linkid=3
  25. thing       frag1           linkid=3
  26. thing       frag2           linkid=3
  27. thing       frag3           linkid=3
  28. thing       frag4           linkid=3
  29. thing       firstblock      linkid=3
  30. thing       keystone
  31. thing       marduk_button
  32. thing       marduk_door
  33. thing       safepos1
  34. thing       safepos2
  35.  
  36. # CUTSCENE GEAR AND ACTORS ########################################
  37.  
  38. thing       camera0                                nolink
  39. thing       camera1                                nolink
  40. thing        camera2                                nolink
  41.  
  42. thing       cam0resetpos                        nolink
  43. thing       cam1resetpos                        nolink
  44.  
  45. thing       actorindy0
  46. thing       actorindy1
  47.  
  48. thing       marduk_col_actor
  49. thing       mdk_column_cam                        nolink
  50. thing       mdk_column_cam2                        nolink
  51. thing       mdk_column_tgt                        nolink
  52. thing       mardukdoor_tgt                        nolink
  53. thing       mdk_resetpos                        nolink
  54.  
  55. thing       target0
  56. thing       target1
  57. thing       target2
  58. thing        br_mk_1
  59.  
  60. cog            tabpickupcog
  61.  
  62. # SOUNDS ##########################################################
  63.  
  64. sound       rumble=nub_bull_move1_c.wav         local
  65. sound       click=olv_quetzdoor_stop_c.wav      local
  66. sound       crashrumble=olv_rockhead_roll_c.wav local
  67. sound       bigcrash=pru_boulder_crash_c.wav    local
  68.    
  69. sound       indylineb0=inxj058.wav      local
  70. sound       indylineb1=inxj059.wav      local
  71. sound       indylineb2=inxj060.wav      local
  72. sound       indylineb3=inxj061.wav      local
  73. sound       indylineb4=inxj090.wav      local
  74. sound       indylineb5=inxj095.wav      local
  75.  
  76. # MISC ############################################################
  77.  
  78. int         bridgeflag0=0   local
  79. int         timerflag=0     local
  80. int         takenflag=0     local
  81. int         keystoneflag=0  local
  82. int         buttonflag=0    local
  83. int         shake           local
  84. int         rumblechannel   local
  85. int         crashrumblchan  local
  86. int         bigcrashchanl   local
  87. int         cursound        local
  88. int         intrack         local
  89. int         vibe            local
  90. int         lastrand=-1     local
  91. int         currand=0       local
  92.  
  93. int         smoke0          local
  94. int         smoke1          local
  95. int         smoke2          local
  96. int         smoke3          local
  97. int         smoke4          local
  98. int         smoke5          local
  99.  
  100. thing       smoketarget0
  101. thing       smoketarget1
  102. thing       smoketarget2
  103. thing       smoketarget3
  104. thing       smoketarget4
  105. thing       smoketarget5
  106.  
  107. vector      posOffset       local      
  108. vector      angOffset       local
  109.  
  110. template    smoketemplate=+bouldersmoke_spr     local
  111.  
  112. surface     mardukdoorsurf
  113.  
  114. # KEYFRAME ########################################################
  115.  
  116. keyframe    in_kneel=0in_stand6.key             local
  117. keyframe    in_stand2kneel=0in_stand1_bd_6.key  local
  118. keyframe    in_kneeltostand=0in_stand6_bd_1.key local
  119.  
  120. ###################################################################
  121.  
  122. end
  123.  
  124. # ========================================================================================
  125. code
  126.  
  127. #----------------------------------------------------------------------------------------
  128.  
  129. startup:
  130.  
  131.     player = GetLocalPlayerThing();
  132.     SetThingFlags(actorindy0, 0x80000);
  133.  
  134. return;
  135.  
  136. #----------------------------------------------------------------------------------------
  137.  
  138. entered:
  139.  
  140.     // Door to Marduk idol    
  141.     if ((GetSenderRef() == marduk_button) && (buttonflag == 0))
  142.     {
  143.         //start cutscene
  144.         buttonflag = 1;
  145.         SetCameraLookInterp(2, 1);
  146.         SetCameraInterpSpeed(2, 2.5);
  147.         Sleep(0.001);
  148.         StartCutscene(1);
  149.         SetActorFlags(player, 0x200000);
  150.         StopThing(player);
  151.         CopyOrient(player, marduk_col_actor);
  152.         TeleportThing(player, safepos1);
  153.         CopyPlayerHolsters(player, marduk_col_actor);
  154.         
  155.         //prep camera
  156.         SetCameraSecondaryFocus(2, mdk_column_tgt);
  157.         SetCameraFocus(2, mdk_column_cam);
  158.         SetCurrentCamera(2);
  159.         SetCameraFOV(90, 0, 0);
  160.         
  161.         //play landing anims
  162.         ClearThingFlags(marduk_col_actor, 0x80000); //bring in stunt indy
  163.         AISetCutsceneMode(marduk_col_actor);
  164.         PlayMode(marduk_col_actor, 55, 0);
  165.         Sleep(0.5);
  166.         
  167.         //play clicking sound
  168.         PlaySoundThing(click, marduk_button, 1, 10, 20, 0x0);
  169.         MoveToFrame(marduk_button, 1, 0.5);
  170.         WaitForStop(marduk_button);
  171.         AISetLookThing(marduk_col_actor, marduk_door);
  172.         Sleep(0.5);
  173.         SetCameraPosInterp(2, 1);
  174.         Sleep(0.1);
  175.         SetCameraFocus(2, mdk_column_cam2);
  176.         SetCameraSecondaryFocus(2, mardukdoor_tgt);
  177.         SetCameraFOV(70, 1, 2);
  178.         Sleep(2.0);
  179.         MoveToFrame(marduk_door, 1, 1);
  180.         WaitForStop(marduk_door);
  181.         ClearAdjoinFlags(mardukdoorsurf, 0x2);
  182.         Sleep(2);
  183.         
  184.         //clear out all camera modes and bring back the player
  185.         TeleportThing(player, marduk_col_actor);
  186.         SetThingFlags(marduk_col_actor, 0x80000);
  187.  
  188.         SetCameraPosition(1, GetThingPos(mdk_resetpos));
  189.         SetCurrentCamera(1);
  190.  
  191.         EndCutscene();
  192.         ClearActorFlags(player, 0x200000);
  193.         SetCameraLookInterp(2, 0);
  194.         SetCameraPosInterp(2, 0);
  195.     }
  196.     
  197.     // Places Block for final piece      
  198.     if ((GetSenderRef() == keystone) && (takenflag == 1) && (keystoneflag == 0))
  199.     {
  200.         //Prep work
  201.         keystoneflag = 1;
  202.         StartCutscene(1);
  203.         SetActorFlags(player, 0x200000);
  204.         TeleportThing(player, safepos2);
  205.         CopyPlayerHolsters(player, actorindy1);
  206.         ClearThingFlags(actorindy1, 0x80000);
  207.         AISetCutsceneMode(actorindy1);
  208.         
  209.         //Prep Cameras & cut
  210.         SetCameraLookInterp(2, 0);
  211.         SetCameraPosInterp(2, 0);
  212.         SetCameraFocus(2, camera1);
  213.         SetCameraSecondaryFocus(2, target2);
  214.         SetCurrentCamera(2);
  215.         SetCameraFOV(80, 0, 0);
  216.         SetCameraLookInterp(2, 1);
  217.         SetCameraPosInterp(2, 1);
  218.         SetCameraInterpSpeed(2, 1.0);
  219.         Sleep(0.01);
  220.         
  221.         //Make actor kneel and get up
  222.         PlayMode(actorindy1, 55, 0);
  223.         Sleep(0.5);
  224.         
  225.         //Start Rumble
  226.         SetPulse(0.1);
  227.         crashrumblchan = PlaySoundLocal(crashrumble, 1, 0, 0x1, 0);
  228.         
  229.         //camera shake
  230.         Sleep(0.5);
  231.         AISetLookThing(actorindy1, frag4);
  232.  
  233.         //pan to block...
  234.         SetCameraFocus(2, camera2);
  235.         SetCameraSecondaryFocus(2, frag4);
  236.         SetCameraFOV(90, 1, 1.0);
  237.         Sleep(1.0);
  238.  
  239.         SetCameraLookInterp(2, 0);
  240.         Sleep(0.01);        
  241.         SetCollideType(frag4, 0);
  242.         MoveToFrame(frag4, 1, 10);
  243.         Sleep(0.25);
  244.         MoveToFrame(frag4, 2, 20);
  245.         ClearThingFlags(frag4, 0x40000000);
  246.         Sleep(0.8);
  247.         StopSound(crashrumblchan, 0);
  248.         PlaySoundLocal(bigcrash, 1, 0, 0x0, 0);
  249.         SetPulse(0);
  250.         //Sleep(1.0);
  251.         
  252.         smoke3 = CreateThing(smoketemplate, smoketarget3);
  253.         AnimateSpriteSize(smoke3, '0.5 0.5 0.5', '1.5 1.5 0.0', 3.0);
  254.         ThingFadeAnim(smoke3, 0.5, 0, 0.5, 0);
  255.         Sleep(0.5);
  256.         
  257.         smoke4 = CreateThing(smoketemplate, smoketarget4);
  258.         AnimateSpriteSize(smoke4, '0.75 0.75 0.5', '2.0 2.0 0.0', 3.0);
  259.         ThingFadeAnim(smoke4, 0.5, 0, 0.5, 0);
  260.         Sleep(0.5);
  261.         
  262.         smoke5 = CreateThing(smoketemplate, smoketarget5);
  263.         AnimateSpriteSize(smoke5, '0.25 0.25 0.5', '1.25 1.25 0.0', 3.0);
  264.         ThingFadeAnim(smoke5, 0.5, 0, 0.5, 0);
  265.         
  266.         //back out of cutscene
  267.         TeleportThing(player, actorindy1);
  268.         SetThingFlags(actorindy1, 0x80000);
  269.         SetCameraPosition(1, GetThingPos(camera2));
  270.         SetCurrentCamera(1);
  271.         SetCameraFOV(90, 0, 0);
  272.         EndCutscene();
  273.         SetCameraPosInterp(2, 0);
  274.         SetCameraInterpSpeed(2, 0);
  275.         Sleep(0.01);
  276.         ClearActorFlags(player, 0x200000);
  277.         SetCollideType(frag4, 3);
  278.     }        
  279.             
  280. return;
  281.  
  282. #----------------------------------------------------------------------------------------
  283.  
  284. user6:
  285.  
  286.     # NOTE: received from tab A pickup cog
  287.     
  288.         SetActorFlags(player, 0x200000);
  289.         SetPulse(0.1);
  290.         crashrumblchan = PlaySoundLocal(crashrumble, 1, 0, 0x1, 0);
  291.         Sleep(0.5);
  292.  
  293.         takenflag=1;
  294.         
  295.         // camera setup
  296.         SetCameraLookInterp(2, 0);
  297.         SetCameraPosInterp(2, 0);
  298.         SetCameraFocus(2, camera0);
  299.         SetCameraSecondaryFocus(2, target0);
  300.         SetCurrentCamera(2);
  301.         SetCameraFOV(90, 0, 0);
  302.         SetCameraLookInterp(2, 1);
  303.         SetCameraInterpSpeed(2, 1.5);
  304.         Sleep(0.01);
  305.         
  306.         // start the debris cut
  307.         CopyPlayerHolsters(player, actorindy0);
  308.         SetThingFlags(player, 0x80000);
  309.         ClearThingFlags(actorindy0, 0x80000);
  310.         AISetCutsceneMode(actorindy0);
  311.         
  312.         //quakin and crashin
  313.         Sleep(0.3);
  314.         AISetMoveSpeed(actorindy0, 0.8);
  315.         AISetLookThing(actorindy0, target1);
  316.         AISetMoveThing(actorindy0, br_mk_1, 0);
  317.         Sleep(1.0);
  318.  
  319.         SetCameraSecondaryFocus(2, target1);
  320.         SetCameraFOV(100, 1, 1.5);
  321.         
  322.         //falling pieces
  323.         SetCollideType(frag0, 0);
  324.         SetCollideType(frag1, 0);
  325.         SetCollideType(frag2, 0);
  326.         SetCollideType(frag3, 0);
  327.         MoveToFrame(frag0, 1, 5);
  328.         MoveToFrame(frag1, 1, 5);
  329.         MoveToFrame(frag2, 1, 5);
  330.         MoveToFrame(frag3, 1, 5);
  331.         Sleep(0.5);
  332.         AttachThingToThing(target1, frag0);
  333.         Sleep(0.3);
  334.         MoveToFrame(frag0, 2, 25);
  335.         MoveToFrame(frag1, 2, 25);
  336.         MoveToFrame(frag2, 2, 25);
  337.         MoveToFrame(frag3, 2, 25);
  338.         WaitForStop(frag2);
  339.         PlaySoundLocal(bigcrash, 1, 0, 0x0, 0);
  340.         StopSound(crashrumblchan, 0);
  341.         SetPulse(0);
  342.         
  343.         smoke0 = CreateThing(smoketemplate, smoketarget0);
  344.         AnimateSpriteSize(smoke0, '0.5 0.5 0.5', '1 1 0.0', 3.0);
  345.         ThingFadeAnim(smoke0, 0.5, 0, 0.5, 0);
  346.         Sleep(0.5);
  347.         smoke1 = CreateThing(smoketemplate, smoketarget1);
  348.         AnimateSpriteSize(smoke1, '0.75 0.75 0.5', '1.75 1.75 0.0', 3.0);
  349.         ThingFadeAnim(smoke0, 0.5, 0, 0.5, 0);
  350.         Sleep(0.5);
  351.         smoke2 = CreateThing(smoketemplate, smoketarget2);
  352.         AnimateSpriteSize(smoke2, '1 1 0.5', '2 2 0.0', 3.0);
  353.         ThingFadeAnim(smoke0, 0.5, 0, 0.5, 0);
  354.  
  355.         SetCollideType(frag0, 3);
  356.         SetCollideType(frag1, 3);
  357.         SetCollideType(frag2, 3);
  358.         SetCollideType(frag3, 3);
  359.         
  360.         //reset cameras and actors
  361.         ClearThingFlags(player, 0x80000);
  362.         SetThingFlags(actorindy0, 0x80000);
  363.         CopyOrientAndPos(actorindy0, player);
  364.  
  365.         SetCameraLookInterp(2, 0);
  366.         SetCameraPOSInterp(2, 0);
  367.         SetCameraPosition(1, GetThingPos(cam0resetpos));
  368.         SetCurrentCamera(1);
  369.         ResetCameraFOV(0, 0.0);
  370.  
  371.         SendMessage(tabpickupcog, user7); # done over here
  372.         ClearActorFlags(player, 0x200000);
  373.  
  374. return;
  375.  
  376.     # HB: I don't understand this...
  377.     
  378.     ## if ((GetCurItem(player) != 0) && (GetSenderID() == 1))
  379.     ## {
  380.     #    StopThing(player);
  381.     #    StartCutscene(1);
  382.     #    SetActorFlags(player, 0x200000);
  383.     #    currand = RandBetween(0, 5);
  384.     #    While (lastrand == currand)
  385.     #    {
  386.     #        currand = RandBetween(0, 5);
  387.     #    }
  388.     #    PlayVoice(player, indylineb0[currand], 1, 1);
  389.     #    lastrand = currand;
  390.     #    EndCutscene();
  391.     #    ClearActorFlags(player, 0x200000);
  392.     ## }
  393.  
  394. #-----------------------------------------------------------------------------------------
  395.  
  396. pulse:
  397.  
  398.     vibe = RandBetween(1, 4);
  399.     if (vibe == 1)
  400.     {
  401.         posOffset = '-0.005 0.00 -0.002';
  402.         angOffset = '0.00 -0.002 0.002';
  403.     }
  404.     if (vibe == 2)
  405.     {
  406.         posOffset = '0.005 -0.005 0.002';
  407.         angOffset = '0.002 0.00 -0.002';
  408.     }
  409.     if (vibe == 3)
  410.     {
  411.         posOffset = '0.002 0.005 -0.005';
  412.         angOffset = '-0.002 0.002 -0.002';
  413.     }
  414.     if (vibe == 4)
  415.     {
  416.         posOffset = '-0.002 0.00 0.005';
  417.         angOffset = '0.00 0.00 0.002';
  418.     }
  419.  
  420.     SetPOVShake(posOffSet, angOffSet, 200.0, 200.0);
  421.  
  422. return;
  423.  
  424. end
  425.  
  426.